const express = require('express')
const app = express()

app.use((req, res, next) => {
  const time = Date.now()
  req.startTime = time;
  console.log('这是第一个全局中间件' + req.startTime);
  next()
})
app.use((req, res, next) => {
  console.log('这是第二个全局中间件' + req.startTime);
  next()
})

app.get('/user', (req, res) => {
  console.log('GET 被调用了' +  req.startTime);
  res.send('GET user...')
})

app.listen(80, () => {
  console.log('80端口服务器启动了...');
})